package com.onlineMIS.action.headQ.report;


import com.onlineMIS.ORM.entity.headQ.inventory.InventoryOrder;

public class HqSalesStatisticReportItemVO extends HqReportItemVO{

	/**
	 * 
	 */
	private static final long serialVersionUID = -6984499835877761941L;

	protected String date = "";
	
	protected int salesQ = 0;//销售量
	protected int returnQ = 0;//退货量
	protected int netQ = 0;//净售量a
	protected int freeQ = 0;//赠品量
	//销售额
	protected double salesPrice = 0;
	//退货额
	protected double returnPrice = 0;
	//净销售额
	protected double netPrice =0;
	//销售成本
	protected double salesCost = 0;
	//退货成本
	protected double returnCost = 0;
	//净销售成本
	protected double netCost = 0;
	//赠品成本
	protected double freeCost = 0;
	//净利润
	protected double netProfit = 0;
	
	private String img = "";
	
	private String dynamicSales = "";
	
	private int orderId;
	
	private String comment;
														
	public HqSalesStatisticReportItemVO(String name, int parentId, int custId, int yearId, int quarterId, int brandId,int categoryLevelId, int categoryId,  int pbId, String state){
		super(name, parentId, custId, yearId, quarterId, brandId, pbId, state,categoryLevelId,categoryId);
	}

	
	public String getImg() {
		return img;
	}
	public void setImg(String img) {
		this.img = img;
	}
	public String getDate() {
		return date;
	}
	public void setDate(String date) {
		this.date = date;
	}
	public int getSalesQ() {
		return salesQ;
	}
	public void setSalesQ(int salesQ) {
		this.salesQ = salesQ;
	}
	public int getReturnQ() {
		return returnQ;
	}
	public void setReturnQ(int returnQ) {
		this.returnQ = returnQ;
	}
	public int getNetQ() {
		return netQ;
	}
	public void setNetQ(int netQ) {
		this.netQ = netQ;
	}
	public int getFreeQ() {
		return freeQ;
	}
	public void setFreeQ(int freeQ) {
		this.freeQ = freeQ;
	}
	public double getSalesPrice() {
		return salesPrice;
	}
	public void setSalesPrice(double salesPrice) {
		this.salesPrice = salesPrice;
	}
	public double getReturnPrice() {
		return returnPrice;
	}
	public void setReturnPrice(double returnPrice) {
		this.returnPrice = returnPrice;
	}
	public double getNetPrice() {
		return netPrice;
	}
	public void setNetPrice(double netPrice) {
		this.netPrice = netPrice;
	}

	public double getSalesCost() {
		return salesCost;
	}
	public void setSalesCost(double salesCost) {
		this.salesCost = salesCost;
	}
	public double getReturnCost() {
		return returnCost;
	}
	public void setReturnCost(double returnCost) {
		this.returnCost = returnCost;
	}
	public double getNetCost() {
		return netCost;
	}
	public void setNetCost(double netCost) {
		this.netCost = netCost;
	}
	public double getFreeCost() {
		return freeCost;
	}
	public void setFreeCost(double freeCost) {
		this.freeCost = freeCost;
	}
	public double getNetProfit() {
		return netProfit;
	}
	public void setNetProfit(double netProfit) {
		this.netProfit = netProfit;
	}	
	public String getDynamicSales() {
		return dynamicSales;
	}
	public void setDynamicSales(String dynamicSales) {
		this.dynamicSales = dynamicSales;
	}
	
	public int getOrderId() {
		return orderId;
	}

	public void setOrderId(int orderId) {
		this.orderId = orderId;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public void putValue(int quantity, int type, double sales, double cost){
		switch (type) {
		case InventoryOrder.TYPE_SALES_ORDER_W:
			this.setSalesPrice(sales);
			this.setSalesCost(cost);
			this.setSalesQ(quantity);
			break;
		case InventoryOrder.TYPE_SALES_RETURN_ORDER_W:
			this.setReturnPrice(sales);
			this.setReturnCost(cost);
			this.setReturnQ(quantity);
			break;
		case InventoryOrder.TYPE_SALES_FREE_ORDER_W:
			this.setFreeCost(cost);
			this.setFreeQ(quantity);
			break;
		default:
			break;
		}
	}

	public void reCalculate(){
		netQ = salesQ - returnQ;
		netPrice = salesPrice - returnPrice;
		netCost = salesCost - returnCost;
		netProfit = netPrice - netCost - freeCost;
	}

}
